/*
 * File:   ChessPiece.h
 * Author: crash
 *
 * Created on March 3, 2011, 7:24 PM
 */

#ifndef CHESSPIECE_H
#define	CHESSPIECE_H

#include "Typesfwd.h"
#include "model/Location.h"
#include "model/ChessBoard.h"
#include "movepiece.h"
#include <iosfwd>

namespace model
{
	class ChessBoard;
	namespace piece
	{
        enum Direction { LEFT, UP, RIGHT, DOWN, LEFTUP, RIGHTUP, RIGHTDOWN, LEFTDOWN };

		Location getOffsetLocation(Direction, const Location&, int, int = 0);

		class ChessPiece
		{
		public:
			const bool isLight;

			ChessPiece(bool);

			void setLocation(const Location* const);

            const Location* getLocation() const;

			ChessPiece(const ChessPiece&);

			friend std::ostream& operator <<(std::ostream&, const ChessPiece&);

			virtual globals::moveSet getPotentialMoves(const ChessBoard&) const = 0;
		protected:
			const Location* currLoc;

			virtual bool cellCheck(const ChessBoard&, const Location&, globals::moveSet&) const;
		};
	}
}
#endif	/* CHESSPIECE_H */
